home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 May / 1991-05.d64 / beginner basic (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  49 lines

  1. 0 clr:rem copyright 1991 compute publications intl ltd - all rights reserved
  2. 10 printchr$(147):poke646,6:poke53280,1:poke53281,1:rem set up screen
  3. 20 dimnu$(22),d$(14):rem 22 is max. no. of names, 14 is digits in tel. number
  4. 30 f(1)=54272:f(2)=54273:f(3)=54279:f(4)=54280:rem voices 1 & 2 frequency
  5. 40 g=54276:h=54283:rem control for voices 1 and 2
  6. 50 vn=65:vf=64:rem vn turns on square wave, vf turns it off
  7. 60 forl=54272to54295:pokel,0:next:rem clear sound chip
  8. 70 poke54296,15:rem full volume
  9. 80 poke54275,8:poke54282,8:rem select square wave
  10. 90 poke54277,20:poke54284,20:rem attack and decay voices 1 and 2
  11. 100 poke54278,192:poke54285,192:rem sustain and release voices 1 and 2
  12. 110 rem next 6 lines assign two frequencies for each key; see article
  13. 120 forn=1to3:w(1,n)=170:w(2,n)=44:next:rem first freq for keys 1, 2 & 3
  14. 130 forn=4to6:w(1,n)=87:w(2,n)=49:next:rem first freq for keys 4, 5 & 6
  15. 140 forn=7to9:w(1,n)=153:w(2,n)=54:next:rem first freq for keys 7, 8 & 9
  16. 150 w(1,0)=77:w(2,0)=60:rem first freq for key 0
  17. 160 forn=1to7step3:w(3,n)=121:w(4,n)=77:next:rem second freq for keys 1, 4 & 7
  18. 170 forn=2to8step3:w(3,n)=156:w(4,n)=85:next:rem second freq for keys 2, 5 & 8
  19. 180 forn=3to9step3:w(3,n)=165:w(4,n)=94:next:rem second freq for keys 3, 6 & 9
  20. 190 w(3,0)=156:w(4,0)=85:rem second freq for key 0
  21. 200 printtab(30)"press
  22. 210 [153][163]30)"return
  23. 220 printtab(30)"to dial
  24. 230 [153]"":[141]350:[141]440
  25. 240 z[178]50:[143] length of tones
  26. 250 [161]a$:[139]a$[179][177]"on"[167][139]a$[179][177]""[167][139]a$[179][177][199](13)[167]250
  27. 260 [139]a$[178]"on"[176]a$[178]""[167][141]440:[137]250
  28. 270 n$[178]nu$(y)
  29. 280 [129]n[178]1[164][195](n$):d$(n)[178][202](n$,n,1):[143] read telephone number
  30. 290 [139]d$(n)[178]"-"[167][130]
  31. 300 [129]t[178]1[164]4:[151]f(t),w(t,([197](d$(n)))):[130]:[143] poke frequencies voices 1 & 2
  32. 310 [151]g,vn:[151]h,vn:[143] tones on
  33. 320 [129]t[178]1[164]z:[130]:[143] length of tones
  34. 330 [151]g,vf:[151]h,vf:[143] tones off
  35. 340 [130]:[137]250
  36. 350 [135]n$,nu$(c):[139]nu$(c)[178]"q"[167][142]
  37. 360 [153][166]3)n$[163]18)nu$(c)
  38. 370 c[178]c[170]1:[139]c[177]22[167][153]"no more than 22 names and numbers!":[128]
  39. 380 [137]350
  40. 390 [131]jim,111-1111: [143]* place your
  41. 400 [131]bill,222-2222:[143]* data on line
  42. 410 [131]mike,333-3333:[143]* 400 through
  43. 420 [131]dave,444-4444:[143]* line 421
  44. 430 [131]q,q:[143] don't change this line!
  45. 440 [151]214,y:[153]:[151]211,2:[153]" "
  46. 450 [139]a$[178]"on"[167]y[178]y[171]1:[139]y[179]0[167]y[178]0
  47. 460 [139]a$[178]""[167]y[178]y[170]1:[139]y[177]c[171]1[167]y[178]c[171]1
  48. 470 [151]214,y:[153]:[151]211,2:[153]"*":[142]
  49.